class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.u: C = None
        self.x: D = None
        self.p: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.w: D = None
        self.o: B = None
        self.y: A = None
        self.t: A = None
        self.txt = txt

g = A("g")
f = B("f")
l = C("l")
b = D("b")
a = C("a")
c = D("c")
h = C("h")
m = D("m")

g.s = f
g.p = f
g.u = l
g.x = c
f.v = c
f.u = g
l.v = f
l.u = g
l.y = g
l.x = h
b.w = c
b.o = f
b.y = g
b.t = g
a.v = f
a.u = g
a.y = g
a.x = h
c.w = m
c.o = f
c.y = g
c.t = g
h.v = f
h.u = g
h.y = g
h.x = l
m.w = c
m.o = f
m.y = g
m.t = g
assert m.o.u.x.txt == "
class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.u: C = None
        self.x: D = None
        self.p: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.w: D = None
        self.o: B = None
        self.y: A = None
        self.t: A = None
        self.txt = txt

g = A("g")
f = B("f")
l = C("l")
b = D("b")
a = C("a")
c = D("c")
h = C("h")
m = D("m")

g.s = f
g.p = f
g.u = l
g.x = c
f.v = c
f.u = g
l.v = f
l.u = g
l.y = g
l.x = h
b.w = c
b.o = f
b.y = g
b.t = g
a.v = f
a.u = g
a.y = g
a.x = h
c.w = m
c.o = f
c.y = g
c.t = g
h.v = f
h.u = g
h.y = g
h.x = l
m.w = c
m.o = f
m.y = g
m.t = g
assert m.o.u.x.txt == "c"