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

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

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

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.p: B = None
        self.txt = txt

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

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

m = A("m")
i = B("i")
h = C("h")
c = D("c")
j = E("j")
e = F("e")
d = A("d")
k = E("k")

m.q = d
i.p = m
i.v = m
i.o = e
h.v = i
h.o = j
c.t = h
c.p = i
j.r = c
j.o = c
j.y = c
j.t = m
j.u = m
j.v = h
e.o = h
e.u = k
d.q = m
k.r = c
k.o = c
k.y = c
k.t = m
k.u = m
k.v = h
assert h.o.v.o.txt == "
class A:
    def __init__(self, txt: str):
        self.q: A = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.p: B = None
        self.txt = txt

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

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

m = A("m")
i = B("i")
h = C("h")
c = D("c")
j = E("j")
e = F("e")
d = A("d")
k = E("k")

m.q = d
i.p = m
i.v = m
i.o = e
h.v = i
h.o = j
c.t = h
c.p = i
j.r = c
j.o = c
j.y = c
j.t = m
j.u = m
j.v = h
e.o = h
e.u = k
d.q = m
k.r = c
k.o = c
k.y = c
k.t = m
k.u = m
k.v = h
assert h.o.v.o.txt == "j"