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

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

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

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

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

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

b = A("b")
a = B("a")
g = C("g")
f = D("f")
j = E("j")
l = F("l")
h = B("h")

b.p = a
b.o = j
b.t = h
a.r = f
a.q = f
a.v = j
a.w = b
a.o = g
a.t = l
g.q = j
g.t = j
g.r = b
g.x = b
g.v = f
g.o = f
f.y = g
j.z = b
l.o = a
l.r = j
l.q = j
h.r = f
h.q = f
h.v = j
h.w = b
h.o = g
h.t = l
assert l.r.z.p.t.o.txt == "
class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.o: E = None
        self.t: B = None
        self.txt = txt

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

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

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

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

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

b = A("b")
a = B("a")
g = C("g")
f = D("f")
j = E("j")
l = F("l")
h = B("h")

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