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

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

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: A = None
        self.z: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.u: C = None
        self.t: A = None
        self.z: C = None
        self.q: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: B = None
        self.r: D = None
        self.p: B = None
        self.y: B = None
        self.w: D = None
        self.txt = txt

n = A("n")
l = B("l")
c = C("c")
j = D("j")
i = E("i")
g = F("g")
f = F("f")
e = A("e")

n.u = l
n.o = j
n.w = j
n.r = g
n.x = g
n.s = f
l.u = f
c.v = e
j.r = e
j.z = c
i.s = e
i.t = e
i.u = c
i.z = c
i.q = j
g.s = l
g.p = l
g.y = l
g.r = j
g.w = j
f.s = l
f.p = l
f.y = l
f.r = j
f.w = j
e.u = l
e.o = j
e.w = j
e.r = g
e.s = g
e.x = g
assert g.y.u.y.u.p.txt == "
class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.o: D = None
        self.r: F = None
        self.s: F = None
        self.w: D = None
        self.x: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: A = None
        self.z: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.u: C = None
        self.t: A = None
        self.z: C = None
        self.q: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: B = None
        self.r: D = None
        self.p: B = None
        self.y: B = None
        self.w: D = None
        self.txt = txt

n = A("n")
l = B("l")
c = C("c")
j = D("j")
i = E("i")
g = F("g")
f = F("f")
e = A("e")

n.u = l
n.o = j
n.w = j
n.r = g
n.x = g
n.s = f
l.u = f
c.v = e
j.r = e
j.z = c
i.s = e
i.t = e
i.u = c
i.z = c
i.q = j
g.s = l
g.p = l
g.y = l
g.r = j
g.w = j
f.s = l
f.p = l
f.y = l
f.r = j
f.w = j
e.u = l
e.o = j
e.w = j
e.r = g
e.s = g
e.x = g
assert g.y.u.y.u.p.txt == "l"