class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.p: I = None
        self.x: B = None
        self.y: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: C = None
        self.w: E = None
        self.r: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: E = None
        self.t: A = None
        self.z: I = None
        self.p: H = None
        self.v: D = None
        self.y: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: A = None
        self.s: G = None
        self.z: D = None
        self.t: I = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: C = None
        self.txt = txt

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

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

g.q = a
g.p = l
g.x = e
g.y = n
e.u = b
e.w = c
e.r = n
b.x = c
b.y = c
b.t = g
b.z = l
b.p = m
b.v = a
a.r = k
a.w = l
c.o = g
c.s = k
c.z = a
c.t = l
n.q = b
n.x = b
k.x = e
m.z = b
l.p = g
assert g.q.w.p.y.x.txt == "
class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.p: I = None
        self.x: B = None
        self.y: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: C = None
        self.w: E = None
        self.r: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: E = None
        self.t: A = None
        self.z: I = None
        self.p: H = None
        self.v: D = None
        self.y: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: A = None
        self.s: G = None
        self.z: D = None
        self.t: I = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: C = None
        self.txt = txt

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

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

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