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

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

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

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.s: E = None
        self.z: E = None
        self.o: I = None
        self.p: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: H = None
        self.t: D = None
        self.w: C = None
        self.u: C = None
        self.v: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: B = None
        self.p: D = None
        self.o: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: D = None
        self.s: A = None
        self.w: G = None
        self.txt = txt

b = A("b")
d = B("d")
a = C("a")
l = D("l")
c = E("c")
f = F("f")
e = G("e")
g = H("g")
k = I("k")

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

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

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

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.s: E = None
        self.z: E = None
        self.o: I = None
        self.p: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: H = None
        self.t: D = None
        self.w: C = None
        self.u: C = None
        self.v: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: B = None
        self.p: D = None
        self.o: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: D = None
        self.s: A = None
        self.w: G = None
        self.txt = txt

b = A("b")
d = B("d")
a = C("a")
l = D("l")
c = E("c")
f = F("f")
e = G("e")
g = H("g")
k = I("k")

b.p = a
b.x = g
d.r = l
d.p = g
d.s = a
a.o = c
a.t = d
a.x = k
l.x = a
l.s = c
l.z = c
l.p = c
l.o = k
c.z = g
c.t = l
c.w = a
c.u = a
c.v = k
f.u = e
e.y = d
e.p = l
e.o = g
g.u = b
k.v = l
k.s = b
k.w = e
assert d.r.p.t.o.w.o.txt == "g"