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

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

class C:
    def __init__(self, txt: str):
        self.t: B = None
        self.q: E = None
        self.y: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: F = None
        self.z: F = None
        self.r: D = None
        self.t: E = None
        self.txt = txt

c = A("c")
d = B("d")
m = C("m")
g = D("g")
k = E("k")
l = F("l")
n = F("n")

c.o = m
c.x = n
d.w = n
d.q = k
d.x = k
m.t = d
m.q = k
m.y = c
g.r = l
k.u = n
l.u = n
l.z = n
l.r = g
l.t = k
n.u = l
n.z = l
n.r = g
n.t = k
assert g.r.z.z.u.txt == "
class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.x: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: B = None
        self.q: E = None
        self.y: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: F = None
        self.z: F = None
        self.r: D = None
        self.t: E = None
        self.txt = txt

c = A("c")
d = B("d")
m = C("m")
g = D("g")
k = E("k")
l = F("l")
n = F("n")

c.o = m
c.x = n
d.w = n
d.q = k
d.x = k
m.t = d
m.q = k
m.y = c
g.r = l
k.u = n
l.u = n
l.z = n
l.r = g
l.t = k
n.u = l
n.z = l
n.r = g
n.t = k
assert g.r.z.z.u.txt == "n"