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

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

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.v: A = None
        self.t: F = None
        self.r: C = None
        self.s: F = None
        self.w: D = None
        self.txt = txt

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

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

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

d = A("d")
n = B("n")
e = C("e")
c = D("c")
b = E("b")
h = F("h")
i = C("i")

d.p = b
d.t = n
n.y = d
n.r = d
e.z = c
e.w = c
e.v = d
e.t = h
e.s = h
e.r = i
c.o = d
c.v = h
b.s = e
b.w = d
b.v = h
h.q = i
i.z = c
i.w = c
i.v = d
i.t = h
i.s = h
i.r = e
assert h.q.v.t.y.txt == "
class A:
    def __init__(self, txt: str):
        self.p: E = None
        self.t: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.v: A = None
        self.t: F = None
        self.r: C = None
        self.s: F = None
        self.w: D = None
        self.txt = txt

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

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

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

d = A("d")
n = B("n")
e = C("e")
c = D("c")
b = E("b")
h = F("h")
i = C("i")

d.p = b
d.t = n
n.y = d
n.r = d
e.z = c
e.w = c
e.v = d
e.t = h
e.s = h
e.r = i
c.o = d
c.v = h
b.s = e
b.w = d
b.v = h
h.q = i
i.z = c
i.w = c
i.v = d
i.t = h
i.s = h
i.r = e
assert h.q.v.t.y.txt == "d"