class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.p: C = None
        self.v: B = None
        self.y: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: B = None
        self.p: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: D = None
        self.y: F = None
        self.r: D = None
        self.txt = txt

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

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

c = A("c")
b = B("b")
d = C("d")
k = D("k")
g = E("g")
j = F("j")
m = D("m")

c.w = d
c.p = d
c.v = b
c.y = j
b.u = m
b.s = j
b.t = d
b.y = c
b.w = c
b.q = g
d.x = b
d.p = g
k.u = m
k.r = m
k.y = j
g.s = c
g.v = d
g.u = j
g.w = j
g.o = b
j.y = b
j.t = g
j.s = c
j.v = c
j.p = d
m.u = k
m.r = k
m.y = j
assert b.u.y.v.p.x.t.txt == "
class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.p: C = None
        self.v: B = None
        self.y: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: B = None
        self.p: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: D = None
        self.y: F = None
        self.r: D = None
        self.txt = txt

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

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

c = A("c")
b = B("b")
d = C("d")
k = D("k")
g = E("g")
j = F("j")
m = D("m")

c.w = d
c.p = d
c.v = b
c.y = j
b.u = m
b.s = j
b.t = d
b.y = c
b.w = c
b.q = g
d.x = b
d.p = g
k.u = m
k.r = m
k.y = j
g.s = c
g.v = d
g.u = j
g.w = j
g.o = b
j.y = b
j.t = g
j.s = c
j.v = c
j.p = d
m.u = k
m.r = k
m.y = j
assert b.u.y.v.p.x.t.txt == "d"