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

class B:
    def __init__(self, txt: str):
        self.v: D = None
        self.o: D = None
        self.p: F = None
        self.w: F = None
        self.s: C = None
        self.z: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: B = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.v: D = None
        self.o: D = None
        self.p: F = None
        self.w: F = None
        self.s: C = None
        self.z: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: B = None
        self.txt = txt

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

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

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

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

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