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

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.v: F = None
        self.r: C = None
        self.y: A = None
        self.q: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.v: C = None
        self.t: C = None
        self.o: E = None
        self.x: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: C = None
        self.w: C = None
        self.txt = txt

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

k = A("k")
b = B("b")
l = C("l")
a = D("a")
d = E("d")
i = F("i")
m = G("m")
e = D("e")
f = E("f")

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

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.v: F = None
        self.r: C = None
        self.y: A = None
        self.q: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.v: C = None
        self.t: C = None
        self.o: E = None
        self.x: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: C = None
        self.w: C = None
        self.txt = txt

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

k = A("k")
b = B("b")
l = C("l")
a = D("a")
d = E("d")
i = F("i")
m = G("m")
e = D("e")
f = E("f")

k.y = b
k.w = b
b.u = k
b.y = k
b.v = i
b.r = l
b.q = d
l.z = k
a.y = l
d.v = l
d.t = l
d.o = f
d.x = a
i.q = l
i.w = l
m.u = l
m.o = l
m.s = f
m.p = b
m.z = b
m.v = k
m.q = i
e.y = l
f.v = l
f.t = l
f.o = d
f.x = e
assert e.y.z.w.txt == "b"