class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.q: E = None
        self.r: D = None
        self.y: C = None
        self.s: F = None
        self.x: F = None
        self.t: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.y: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: C = None
        self.txt = txt

k = A("k")
b = B("b")
g = C("g")
c = D("c")
d = E("d")
e = F("e")
i = G("i")
n = B("n")
l = G("l")
j = D("j")

k.p = g
k.y = g
k.q = d
k.t = d
k.r = j
k.s = e
k.x = e
b.v = g
b.u = n
b.y = k
b.r = i
b.w = d
b.q = e
g.u = e
g.v = l
c.x = l
c.z = l
c.v = n
d.s = k
d.y = j
e.p = b
i.p = g
n.v = g
n.u = b
n.y = k
n.r = i
n.w = d
n.q = e
l.p = g
j.x = i
j.z = l
j.v = b
assert l.p.u.p.txt == "
class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.q: E = None
        self.r: D = None
        self.y: C = None
        self.s: F = None
        self.x: F = None
        self.t: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.y: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: C = None
        self.txt = txt

k = A("k")
b = B("b")
g = C("g")
c = D("c")
d = E("d")
e = F("e")
i = G("i")
n = B("n")
l = G("l")
j = D("j")

k.p = g
k.y = g
k.q = d
k.t = d
k.r = j
k.s = e
k.x = e
b.v = g
b.u = n
b.y = k
b.r = i
b.w = d
b.q = e
g.u = e
g.v = l
c.x = l
c.z = l
c.v = n
d.s = k
d.y = j
e.p = b
i.p = g
n.v = g
n.u = b
n.y = k
n.r = i
n.w = d
n.q = e
l.p = g
j.x = i
j.z = l
j.v = b
assert l.p.u.p.txt == "b"