class A:
    def __init__(self, txt: str):
        self.r: F = None
        self.u: F = None
        self.x: D = None
        self.w: E = None
        self.o: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.z: D = None
        self.u: B = None
        self.r: E = None
        self.s: D = None
        self.w: E = None
        self.p: C = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.z: D = None
        self.u: B = None
        self.r: E = None
        self.s: D = None
        self.w: E = None
        self.p: C = None
        self.txt = txt

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

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

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

k.r = j
k.u = j
k.x = a
k.w = m
k.o = d
g.x = j
g.y = m
g.u = d
d.x = m
a.z = e
a.s = e
a.u = g
a.r = m
a.w = m
a.p = d
m.r = d
m.x = d
m.t = j
m.w = j
j.u = d
b.x = j
b.y = m
b.u = d
e.z = a
e.s = a
e.u = g
e.r = m
e.w = m
e.p = d
assert k.x.w.r.txt == "d"