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

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

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

class D:
    def __init__(self, txt: str):
        self.q: F = None
        self.s: B = None
        self.z: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: D = None
        self.o: A = None
        self.y: B = None
        self.z: B = None
        self.p: D = None
        self.v: F = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.q: F = None
        self.s: B = None
        self.z: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: D = None
        self.o: A = None
        self.y: B = None
        self.z: B = None
        self.p: D = None
        self.v: F = None
        self.txt = txt

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

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