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

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.v: A = None
        self.p: D = None
        self.txt = txt

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

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

k = A("k")
g = B("g")
b = C("b")
e = D("e")
f = E("f")
m = F("m")
j = G("j")

k.t = f
k.w = f
k.z = b
g.q = b
g.o = m
g.t = m
g.y = e
g.u = e
b.v = f
b.o = j
b.x = m
e.o = g
e.t = g
e.y = b
f.r = e
f.p = e
f.v = k
m.z = f
m.x = b
j.q = m
assert k.t.p.o.y.y.txt == "
class A:
    def __init__(self, txt: str):
        self.t: E = None
        self.z: C = None
        self.w: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.v: A = None
        self.p: D = None
        self.txt = txt

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

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

k = A("k")
g = B("g")
b = C("b")
e = D("e")
f = E("f")
m = F("m")
j = G("j")

k.t = f
k.w = f
k.z = b
g.q = b
g.o = m
g.t = m
g.y = e
g.u = e
b.v = f
b.o = j
b.x = m
e.o = g
e.t = g
e.y = b
f.r = e
f.p = e
f.v = k
m.z = f
m.x = b
j.q = m
assert k.t.p.o.y.y.txt == "b"