class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.q: E = None
        self.t: G = None
        self.z: G = None
        self.r: B = None
        self.v: E = None
        self.s: D = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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