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

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: A = None
        self.u: A = None
        self.o: A = None
        self.p: C = None
        self.x: A = None
        self.txt = txt

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

b = A("b")
n = B("n")
k = C("k")
h = D("h")
l = E("l")
a = F("a")
c = E("c")
d = C("d")

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: A = None
        self.u: A = None
        self.o: A = None
        self.p: C = None
        self.x: A = None
        self.txt = txt

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

b = A("b")
n = B("n")
k = C("k")
h = D("h")
l = E("l")
a = F("a")
c = E("c")
d = C("d")

b.x = c
b.y = d
n.x = l
n.z = b
n.p = k
n.r = a
k.s = n
k.v = h
k.w = l
h.t = a
h.q = c
h.p = n
l.v = b
l.u = b
l.o = b
l.x = b
l.p = d
a.x = b
a.r = b
a.p = h
a.z = h
a.y = k
c.v = b
c.u = b
c.o = b
c.x = b
c.p = d
d.s = n
d.v = h
d.w = c
assert b.x.v.y.txt == "d"