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

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

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.t: B = None
        self.x: A = None
        self.p: A = None
        self.s: B = None
        self.w: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.w: E = None
        self.t: E = None
        self.z: B = None
        self.y: C = None
        self.v: A = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.t: B = None
        self.x: A = None
        self.p: A = None
        self.s: B = None
        self.w: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.w: E = None
        self.t: E = None
        self.z: B = None
        self.y: C = None
        self.v: A = None
        self.txt = txt

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

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