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

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

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.s: D = None
        self.t: A = None
        self.v: D = None
        self.x: F = None
        self.o: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

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

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

m = A("m")
a = B("a")
c = C("c")
h = D("h")
l = E("l")
b = F("b")
g = E("g")

m.t = c
m.w = h
m.u = b
a.z = m
a.t = g
a.x = g
a.q = c
a.s = h
a.p = b
c.r = h
c.s = h
c.v = h
c.o = h
c.t = m
c.x = b
h.o = c
l.p = g
l.w = a
l.s = a
l.x = b
b.r = a
b.o = l
g.p = l
g.w = a
g.s = a
g.x = b
assert h.o.r.o.r.o.v.o.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.w: D = None
        self.u: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.s: D = None
        self.t: A = None
        self.v: D = None
        self.x: F = None
        self.o: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

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

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

m = A("m")
a = B("a")
c = C("c")
h = D("h")
l = E("l")
b = F("b")
g = E("g")

m.t = c
m.w = h
m.u = b
a.z = m
a.t = g
a.x = g
a.q = c
a.s = h
a.p = b
c.r = h
c.s = h
c.v = h
c.o = h
c.t = m
c.x = b
h.o = c
l.p = g
l.w = a
l.s = a
l.x = b
b.r = a
b.o = l
g.p = l
g.w = a
g.s = a
g.x = b
assert h.o.r.o.r.o.v.o.txt == "c"