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

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: C = None
        self.txt = txt

l = A("l")
h = B("h")
n = C("n")
f = D("f")
b = E("b")
g = C("g")

l.o = b
l.z = b
l.t = n
h.p = l
n.x = g
n.w = b
n.p = b
f.w = b
b.t = g
g.x = n
g.w = b
g.p = b
assert n.p.t.x.x.txt == "
class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.t: C = None
        self.z: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: C = None
        self.txt = txt

l = A("l")
h = B("h")
n = C("n")
f = D("f")
b = E("b")
g = C("g")

l.o = b
l.z = b
l.t = n
h.p = l
n.x = g
n.w = b
n.p = b
f.w = b
b.t = g
g.x = n
g.w = b
g.p = b
assert n.p.t.x.x.txt == "g"