class A:
    def __init__(self, txt: str):
        self.t: E = None
        self.p: F = None
        self.w: F = None
        self.u: B = None
        self.q: C = None
        self.s: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.p: F = None
        self.z: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.r: A = None
        self.p: C = None
        self.x: A = None
        self.t: F = None
        self.u: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: E = None
        self.q: D = None
        self.txt = txt

b = A("b")
j = B("j")
g = C("g")
l = D("l")
m = E("m")
i = F("i")

b.t = m
b.p = i
b.w = i
b.s = i
b.u = j
b.q = g
j.s = m
g.s = b
g.p = i
g.z = l
l.v = i
m.s = g
m.p = g
m.u = g
m.r = b
m.x = b
m.t = i
i.p = m
i.q = l
assert m.t.p.r.w.txt == "
class A:
    def __init__(self, txt: str):
        self.t: E = None
        self.p: F = None
        self.w: F = None
        self.u: B = None
        self.q: C = None
        self.s: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.p: F = None
        self.z: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.r: A = None
        self.p: C = None
        self.x: A = None
        self.t: F = None
        self.u: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: E = None
        self.q: D = None
        self.txt = txt

b = A("b")
j = B("j")
g = C("g")
l = D("l")
m = E("m")
i = F("i")

b.t = m
b.p = i
b.w = i
b.s = i
b.u = j
b.q = g
j.s = m
g.s = b
g.p = i
g.z = l
l.v = i
m.s = g
m.p = g
m.u = g
m.r = b
m.x = b
m.t = i
i.p = m
i.q = l
assert m.t.p.r.w.txt == "i"