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

class B:
    def __init__(self, txt: str):
        self.t: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.o: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.s: B = None
        self.x: B = None
        self.r: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: E = None
        self.q: D = None
        self.u: E = None
        self.s: E = None
        self.z: A = None
        self.txt = txt

b = A("b")
i = B("i")
k = C("k")
f = D("f")
g = E("g")
l = F("l")
n = C("n")
d = B("d")

b.y = k
b.w = n
i.t = k
k.w = b
k.o = b
f.p = b
f.s = d
f.r = d
f.x = i
g.z = f
g.t = n
g.w = b
g.r = l
g.p = k
g.q = i
l.x = g
l.u = g
l.s = g
l.q = f
l.z = b
n.w = b
n.o = b
d.t = n
assert k.o.y.w.y.txt == "
class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.w: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.o: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.s: B = None
        self.x: B = None
        self.r: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: E = None
        self.q: D = None
        self.u: E = None
        self.s: E = None
        self.z: A = None
        self.txt = txt

b = A("b")
i = B("i")
k = C("k")
f = D("f")
g = E("g")
l = F("l")
n = C("n")
d = B("d")

b.y = k
b.w = n
i.t = k
k.w = b
k.o = b
f.p = b
f.s = d
f.r = d
f.x = i
g.z = f
g.t = n
g.w = b
g.r = l
g.p = k
g.q = i
l.x = g
l.u = g
l.s = g
l.q = f
l.z = b
n.w = b
n.o = b
d.t = n
assert k.o.y.w.y.txt == "k"