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

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

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

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

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

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

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

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

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

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

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

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

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

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

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